import qs from 'qs'
import axios from 'axios'
let instance = axios.create()
const myaxios = {

    /**
     * 发送一个get请求
     * @param {string} url   请求资源路径
     * @param {object} params  请求参数对象 {key:value,key2:value2}
     */
    get(url,params){
        return instance({
            method:'GET',
            url,
            params,
        })
    },
    post(url,params){
        return instance({
            method:'POST',
            url,
            data:qs.stringify(params),
        })
    },

}

export default myaxios